<?php
namespace Home\Controller;
use Think\Controller;
class TieController extends Controller {
	public function tie(){
		
		  $Tie=D('Tie');
		  $Tie->create();


		$upload = new \Think\Upload();// 实例化上传类
        $upload->maxSize   =     3145728 ;// 设置附件上传大小
        $upload->autoSub = false;//使用子目录保存上传文件
		$upload->subName = array('date','Ymd');
        $upload->allowExts  = $ext_arr[$type];// 设置附件上传类型
        $upload->rootPath =  "./Public/Uploads/";// 设置附件上传目录
		$info   =   $upload->upload();
		  if(!$info) {
			  $this->error($upload->getError());
		  }
				
		  
		
		 $Tie->add=$info["filename"]['savename'];
		 //$Tie->class=$type;
		  //$message->uid=$_SESSION['id'];
		  //$message->time=time();
		 
		  $arr=$Tie->add();
		   if($arr){
		   $this->success('提交成功');
		   $User=M('User');
			$where['uid']=$_SESSION['uid'];
			$User->where($where)->setInc('exper',3);
		   }else {
		  		    $this->error('留言失败');
	 	   }
		
		
		
		
		
		
		
	}
	
	
}
?>